/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

/**
 * <p>Project: jse2303 - StringBuilderDemo
 * <p>Powered by webrx On 2023-07-17 15:25:49
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class StringBuilderDemo {
    public static void main(String[] args) {
        //StringBuilder su = new StringBuilder();
        //StringBuilder su = new StringBuilder(100);
        //StringBuilder su = new StringBuilder("hello");
        //System.out.println(su);
        //System.out.println(su.reverse().reverse().toString().toUpperCase());

        StringBuilder sbu = new StringBuilder();
        sbu.append("hello");
        sbu.insert(0, "java8.0，");
        sbu.append("html");

        sbu.delete(13, 100);
        System.out.println(sbu.indexOf("html"));
        System.out.println(sbu.length());
        System.out.println(sbu.lastIndexOf("html", 13));

        //sbu.replace(0, 4, "javascript");
        System.out.println(sbu);
        sbu.replace(4, 4, "script");
        String s1 = sbu.substring(0, 3);
        String s2 = sbu.substring(3);
        System.out.println(s1);
        System.out.println(s2);

        System.out.println(sbu);

        //String s3 = sbu.toString();
    }
}
